package com.yf.dxapp.module.app.component.app;

import cn.hutool.http.HttpUtil;
import com.yf.dxapp.module.app.enums.app.LevelEnum;
import org.springframework.stereotype.Component;

@Component
public class DouxinGroupComponent {

    public Long getLevelByMobile(String mobile) {
        try {
            String response = HttpUtil.get("https://server.douxingroup.com/dxm/api/app/mini/user/level?phone=" + mobile);
            return Long.parseLong(response.replace("\"", ""));
        } catch (Exception e) {
            return LevelEnum.YK.levelId;
        }
    }
}
